//导入axios
import axios from "axios";
import auth from '@/auth/auth.js'

var baseURL = "http://81.68.141.149:8081";
//创建axios实例
const axiosInstance = axios.create({
    baseURL: baseURL,//前置URL地址
    timeout: 500000 //请求超时时间
})
//定义拦截器
axiosInstance.interceptors.request.use(function (config){
    config.headers.Authorization = auth.getToken();
    return config;
},function (error) {
    return Promise.reject(error);
});

//默认导出
export {axiosInstance,baseURL} ;